package com.djhu.springsimple.util;

/**
 * @author by zw on 2018/4/16.
 */
public class ObjectUtils {

    private static final String EMPTY_STRING = "";
    private static final String NULL_STRING = "null";

    public static String identityToString(Object obj) {
        if (obj == null) {
            return EMPTY_STRING;
        }
        return obj.getClass().getName() + "@" + getIdentityHexString(obj);
    }

    public static String getIdentityHexString(Object obj) {
        return Integer.toHexString(System.identityHashCode(obj));
    }


}